//类的继承

//父类
class Animal{
    name : string;
    constructor(name:string){
        this.name=name;
    }

    sayHi(): string{
        return `我的名字:${this.name}`;

    }
}

class Cat extends Animal {

    constructor(name : string){
        super(name);//必须调用： super 表示父类的构造方法
        console.log(this.name);
    }
    sayHi(): string {
        return `调用父类方法-->${super.sayHi()}`;
    }

}

let cat= new Cat(`甜甜`);
console.log(cat.sayHi());